<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="css/element.css" rel="stylesheet"/>
    <link href="css/styleindex.css" rel="stylesheet"/>
    <style>
    .el-tabs__item.is-active{
      color: #058142;
    }.el-tabs__active-bar{
      background-color: #058142;
    }.el-tabs{
      background-color: #fff;
    }.el-input__inner{
      border: 0;
      font-size: 1rem;
      text-align: center;
    }.el-input__prefix{
      display: none;
    }
    </style>
</head>
<body style="background: #ffffff;">

  <div class="mui-content" style="margin-bottom:50px;">
    <div id="vm" class="x-examok" v-cloak>
      <div class="x-my-bg">
        <div class="x-my-topname">
          <div class="x-mytop-l">
            <img :src="headimg" alt="">
            <div class="x-my-name">{{myname}}</div>
          </div>
          <div class="x-mytop-r" @click="editlogin"><i class="el-icon-switch-button"></i>退出登录</div>
        </div>
      </div>
      <!--  -->
      <div class="x-ico-month x-ico-month2">
        <el-date-picker v-model="cardsmonth" type="month" placeholder="选择月" @change="getmonth" format="yyyy 年 MM 月" value-format="yyyyMM" :editable="notkey"></el-date-picker>
      </div>
      <!--  -->
      <!-- <el-tabs v-model="activeName" @tab-click="handleClick" stretch="true">
        <el-tab-pane label="我的日记" name="first"> -->
          <!--  -->
          <div class="" style="border-bottom:1px solid #f5f5f5;">
            <div class="x-pro-pro">
              <div class="x-pro-left">
                <div class="x-pro-row">
                  <div class="x-pro-label">现岗位:</div>
                  <div class="x-pro-input">{{mydesc1}}</div>
                </div>
                <!-- <div class="x-pro-row">
                  <div class="x-pro-label">现职级:</div>
                  <div class="x-pro-input">{{mydesc2}}</div>
                </div> -->
                <div class="x-pro-row">
                  <div class="x-pro-label">本月执行力指数:</div>
                  <div class="x-pro-input">{{mydesc3}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">本月组排名:</div>
                  <div class="x-pro-input">{{mydesc4}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">系统月排名:</div>
                  <div class="x-pro-input">{{mydesc5}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">本年执行力指数:</div>
                  <div class="x-pro-input">{{mydesc6}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">本年组排名:</div>
                  <div class="x-pro-input">{{mydesc7}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">系统年排名:</div>
                  <div class="x-pro-input">{{mydesc8}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">本年分享热度(点赞):</div>
                  <div class="x-pro-input">{{mydesc9}}</div>
                </div>
                <div class="x-pro-row">
                  <div class="x-pro-label">热度排名:</div>
                  <div class="x-pro-input">{{mydesc10}}</div>
                </div>
              </div>
            </div>
          </div>
          <!--  -->
          <div class="" v-if="mynote!=''" style="margin:1rem;">
            <div class="x-card" v-for="item in mynote" :key="item.key" @click="gorow(item.id)">
              <div class="x-list-title">{{item.title}}</div>
              <!-- <div class="x-page-desc">评论的详细内容</div> -->
              <div class="x-page-dis">
                <div class="x-dis-cell">{{item.in_date}}</div>
                <div class="x-dis-cell">职务：{{item.job_title}}</div>
                <div class="x-dis-cell x-dis-co" v-if="item.like_memberid>'0'">已推荐</div>
                <div class="x-dis-cell" v-else>未推荐</div>
              </div>
            </div>
          </div>
          <div class="x-nothing" v-else>还没有日记</div>
        <!-- </el-tab-pane> -->
        <!-- <el-tab-pane label="消息通知" name="second">
          <template>
            <el-table :data="tableData"  @cell-click='goincardlist'>
              <el-table-column label="下发时间" width="">
                <template slot-scope="scope">
                  {{scope.row.dept_title}}
                </template>
              </el-table-column>
              <el-table-column label="下发人" width="">
                <template slot-scope="scope">
                  {{scope.row.n}}
                </template>
              </el-table-column>
              <el-table-column label="下发部门" width="">
                <template slot-scope="scope">
                  {{scope.row.count}}
                </template>
              </el-table-column>
              <el-table-column label="职务" width="">
                <template slot-scope="scope">
                  {{scope.row.n}}
                </template>
              </el-table-column>
              <el-table-column label="是否接收" width="">
                <template slot-scope="scope">
                  {{scope.row.count}}
                </template>
              </el-table-column>
              <el-table-column label="查看内容" width="">
                <el-button type="text">查看</el-button>
              </el-table-column>
            </el-table>
          </template>
        </el-tab-pane> -->
      <!-- </el-tabs> -->
      <!--  -->
      <el-dialog
        title=""
        :visible.sync="dialogVisible"
        width="80%">
        <span>这是一段信息</span>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        </span>
      </el-dialog>
    </div>
  </div>

  <script type="text/javascript" src="./script/vue.js"></script>
  <script type="text/javascript" src="./script/element.js"></script>
  <script type="text/javascript" src="./script/api.js"></script>
  <script type="text/javascript" src="./script/base.js"></script>
	<script>
apiready = function () {
    api.setRefreshHeaderInfo({
        loadingImg: 'widget://image/refresh.png',
        bgColor: '#ccc',
        textColor: '#fff',
        textDown: '下拉刷新...',
        textUp: '松开刷新...'
    }, function(ret, err) {
        setTimeout(function(){api.refreshHeaderLoadDone()},500)
        vm.getdataone()
    });


    //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          cardsmonth:'',
          notkey:false,
          activeName: 'first',
          istype:'0',
          tableData:[],
          dialogVisible:false,
          mynote:'',
          mydesc1:'',
          mydesc2:'',
          mydesc3:'',
          mydesc4:'',
          mydesc5:'',
          mydesc6:'',
          mydesc7:'',
          mydesc8:'',
          mydesc9:'',
          mydesc10:'',
          headimg:'',
          myname:'',

        }
      },
      created:function() {
        var that=this;


      },
      mounted:function(){
        var that=this;
        //当前月份
        var date = new Date();
        var year = date.getFullYear();
        var month = date.getMonth()+1;
        if(month<10){
          month = '' + 0 + month;
        }
        var toMonth = '' + year + month ;
        that.cardsmonth = toMonth;
        that.myname = $api.getStorage('username');
        that.headimg = $api.getStorage('avatarth');
        that.getdataone()

      },
      methods: {
        //get我的日记
        getdataone:function(){
          let that=this;
          api.ajax({
            url:baseurl+'api/member/my',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('apptoken'),
                date:that.cardsmonth
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              // console.log(JSON.stringify(ret));
              if(ret.status == 1){
                  that.mydesc1 = ret.data.executive.job_title;
                  that.mydesc2 = ret.data.executive.level_title;
                  that.mydesc3 = ret.data.executive.month_num;
                  that.mydesc4 = ret.data.executive.group_month_rank;
                  that.mydesc5 = ret.data.executive.sys_month_rank;
                  that.mydesc6 = ret.data.executive.year_num;
                  that.mydesc7 = ret.data.executive.group_year_rank;
                  that.mydesc8 = ret.data.executive.sys_year_rank;
                  that.mydesc9 = ret.data.executive.zan_num;
                  that.mydesc10 = ret.data.executive.sys_zan_rank;

                  that.mynote = ret.data.list;

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
        //get消息通知 还没写
        getdatatwo:function(){
          let that=this;
          api.ajax({
            url:baseurl+'api/person/list',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('apptoken')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                that.perdata = ret.data.list;

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
        //查看日记
        gorow:function(id){
          api.openWin({
              name: 'seenote',
              url: './note/seenote.html',
              pageParam: {
                  id: id
              }
          });
        },
        //退出登录
        editlogin:function(){
          api.confirm({
              title: '确定要退出登录吗',
              msg: '',
              buttons: ['确定', '取消']
          }, function(ret, err) {
              var index = ret.buttonIndex;
              if(index=='1'){
                $api.setStorage('apptoken','');
                $api.setStorage('applimits','');
                api.sendEvent({
                    name: 'changeinfo',
                    extra: {
                
                    }
                });
                api.openWin({
                    name: 'login',
                    url: './login.html',
                    slidBackEnabled:false,
                });
              }
          });
        },
        //月份
        getmonth:function(val){
          var that = this;
          console.log(val);
          that.cardsmonth = val;
          if(that.istype=='0'){
            that.getdataone()
          }else if(that.istype=='1'){
            that.getdatatwo()
          }

        },
        //选项卡
        handleClick(tab, event) {
          let id = event.target.getAttribute('id').split('-');
          let whitetab = id.join('').substring(3,9);
          let that = this;
          if(whitetab=='first'){//
            that.istype = '0';
            that.getdataone()
          }else if(whitetab=='second'){//
            that.istype = '1';
            that.getdatatwo()
          }
        },
        //查看消息通知 还没写
        goincardlist:function(val){
          var that = this;
          console.log(val);
          that.dialogVisible = true;

        },
      }
    })
	}


	</script>
</body>
</html>
